package com.lanmon.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	public static String DEFAULT_DATE_FORMAT_STR = "yyyy-MM-dd";
	public static SimpleDateFormat DEFAULT_SDF = new SimpleDateFormat(DEFAULT_DATE_FORMAT_STR);
	public static SimpleDateFormat SDF;
			
	public static String formatDate(Date date, String format) {
		try {
			return (SDF = new SimpleDateFormat(format)).format(date);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
